package coroutines.coroutinescope.exception

import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking

class RunBlockingExceptionTest {
}

fun main() {
    println("main start()")

    /**
     * 协同作用域，异常会向上传递
     * */
    runBlocking {
        launch {
            delay(100)
            println("launch() 0")
        }

        launch {
            delay(200)
            println("launch() 1")

            throw Throwable("error: 2233娘")
        }

        launch {
            delay(300)
            println("launch() 3")
        }
    }

    println("main end()")
}